﻿{% extends "../../../templates/admin_template.html" %}
{% block content %}

<h1>Lista de Alimentos</h1>
<table>
	<thead>
		<tr><td colspan="2"></td><th colspan="3" style="text-align:center">Calorías</th><th colspan="4" style="text-align:center">Se sirve en</th></tr>
		<tr style="border-botton: 1px solid black;">
			<th>Nombre</th>
			<th>Unidad</th>
			<th>Carbos</th>
			<th>Proteínas</th>
			<th>Grasas</th>
			<th>Desayuno</th>
			<th>Almuerzo</th>
			<th>Once/Cena</th>
			<th>Colación</th>
		</tr>
	</thead>
	<tbody>
{% for f in food_elements %}
	<tr style="background-color:{% cycle #eeeeee,#f3f3f3 %}">
		
		<td>{{f.name}}</td>
		<td>{{f.unit}}</td>
		<td>{{f.carb_calories}}</td>
		<td>{{f.protein_calories}}</td>
		<td>{{f.fat_calories}}</td>
		<td style="text-align:center">{% if f.serves_breakfast %} <img src="/img/ok.png" height="30" />{% else %}<img src="/img/not.png" height="30"/> {% endif %}</td>
		<td style="text-align:center">{% if f.serves_lunch %} <img src="/img/ok.png" height="30"/>{% else %}<img src="/img/not.png" height="30"/> {% endif %}</td>
		<td style="text-align:center">{% if f.serves_dinner %} <img src="/img/ok.png" height="30"/>{% else %}<img src="/img/not.png" height="30"/> {% endif %}</td>
		<td style="text-align:center">{% if f.serves_snack %} <img src="/img/ok.png" height="30"/>{% else %}<img src="/img/not.png" height="30"/> {% endif %}</td>
	</tr>
{% endfor %}
	</tbody>
</table>
<a href="/admin/foods/add">Agregar Alimentos</a>

{% endblock content %}

